
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

    <title>Test definitions in version control &#8212; LAVA 2024.05 documentation</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/bootstrap-sphinx.css" />
    <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/sphinx_highlight.js"></script>
    <link rel="shortcut icon" href="_static/favicon.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Lava-Test Test Definition 1.0" href="lava_test_shell.html" />
    <link rel="prev" title="Writing a Lava-Test Test Definition 1.0" href="writing-tests.html" />
    <link rel="canonical" href="https://docs.lavasoftware.org/lava/test-repositories.html" />
  
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="_static/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="_static/bootstrap-3.4.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>


  </head><body>

  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="index.html"><span><img src="_static/lava.png"></span>
          LAVA</a>
        <span class="navbar-text navbar-version pull-left"><b>2024.05</b></span>
      </div>

        <div class="collapse navbar-collapse nav-collapse">
          <ul class="nav navbar-nav">
            
                <li><a href="genindex.html">Index</a></li>
                <li><a href="contents.html">Contents</a></li>
            
            
              <li class="dropdown globaltoc-container">
  <a role="button"
     id="dLabelGlobalToc"
     data-toggle="dropdown"
     data-target="#"
     href="index.html">Site <b class="caret"></b></a>
  <ul class="dropdown-menu globaltoc"
      role="menu"
      aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Introduction to LAVA</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="contents.html">Contents</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary of terms</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="support.html">Getting support</a></li>
</ul>
</ul>
</li>
              
                <li class="dropdown">
  <a role="button"
     id="dLabelLocalToc"
     data-toggle="dropdown"
     data-target="#"
     href="#">Page <b class="caret"></b></a>
  <ul class="dropdown-menu localtoc"
      role="menu"
      aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">Test definitions in version control</a><ul>
<li><a class="reference internal" href="#job-definitions-in-version-control">Job definitions in version control</a></li>
<li><a class="reference internal" href="#using-specific-branch-of-a-test-definition-repository">Using specific branch of a test definition repository</a></li>
<li><a class="reference internal" href="#using-specific-revisions-of-a-test-definition">Using specific revisions of a test definition</a></li>
<li><a class="reference internal" href="#shallow-clones-in-git">Shallow clones in GIT</a></li>
<li><a class="reference internal" href="#removing-git-history">Removing git history</a></li>
<li><a class="reference internal" href="#sharing-the-contents-of-test-definitions">Sharing the contents of test definitions</a></li>
<li><a class="reference internal" href="#test-repository-for-functional-tests-in-lava">Test repository for functional tests in LAVA</a></li>
<li><a class="reference internal" href="#using-kernel-messages-in-a-test-shell">Using kernel messages in a test shell</a><ul>
<li><a class="reference internal" href="#syntax">Syntax</a></li>
<li><a class="reference internal" href="#limitations">Limitations</a><ul>
<li><a class="reference internal" href="#login">Login</a></li>
<li><a class="reference internal" href="#stdout">stdout</a></li>
<li><a class="reference internal" href="#definitions">Definitions</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</ul>
</li>
              
            
            
              
                
  <li>
    <a href="writing-tests.html" title="Previous Chapter: Writing a Lava-Test Test Definition 1.0"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Writing a Lav...</span>
    </a>
  </li>
  <li>
    <a href="lava_test_shell.html" title="Next Chapter: Lava-Test Test Definition 1.0"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Lava-Test Tes... &raquo;</span>
    </a>
  </li>
              
            
            
            
            
              <li class="hidden-sm"></li>
            
          </ul>

          
            
<form class="navbar-form navbar-right" action="search.html" method="get">
 <div class="form-group">
  <input type="text" name="q" class="form-control" placeholder="Search" />
 </div>
  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>
          
        </div>
    </div>
  </div>

<div class="container">
  <div class="row">
    <div class="body col-md-12 content" role="main">
      
  <section id="test-definitions-in-version-control">
<span id="test-repos"></span><span id="index-0"></span><h1>Test definitions in version control<a class="headerlink" href="#test-definitions-in-version-control" title="Permalink to this heading">¶</a></h1>
<p>LAVA supports git version control for use with test definitions, and
this is the recommended way to host and use test definitions for LAVA. When a
repository is listed in a test definition, the entire repository is checked
out. This allows YAML files in the repository to reliably access scripts and
other files which are part of the repository, inside the test image.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">test</span><span class="p">:</span>
<span class="w">   </span><span class="nt">role</span><span class="p">:</span>
<span class="w">   </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">server</span>
<span class="w">   </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">client</span>
<span class="w">   </span><span class="nt">definitions</span><span class="p">:</span>
<span class="w">   </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">repository</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http://git.linaro.org/lava-team/lava-functional-tests.git</span>
<span class="w">     </span><span class="nt">from</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">git</span>
<span class="w">     </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lava-test-shell/multi-node/multinode02.yaml</span>
<span class="w">     </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">multinode-intermediate</span>
</pre></div>
</div>
<p>When this test starts, the entire repository will be available in the current
working directory of the test. Therefore, <code class="docutils literal notranslate"><span class="pre">multinode/multinode02.yaml</span></code> can
include instructions to execute <code class="docutils literal notranslate"><span class="pre">multinode/get_ip.sh</span></code>.</p>
<section id="job-definitions-in-version-control">
<h2>Job definitions in version control<a class="headerlink" href="#job-definitions-in-version-control" title="Permalink to this heading">¶</a></h2>
<p>It is normally recommended to also store your test job YAML files in the
repository. This helps others who may want to use your test definitions.:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">git</span><span class="o">.</span><span class="n">linaro</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">lava</span><span class="o">-</span><span class="n">team</span><span class="o">/</span><span class="n">refactoring</span><span class="o">.</span><span class="n">git</span><span class="o">/</span><span class="n">tree</span><span class="o">/</span><span class="n">panda</span><span class="o">-</span><span class="n">multinode</span><span class="o">.</span><span class="n">yaml</span>
</pre></div>
</div>
<p>There are numerous test repositories in use daily in Linaro that may be good
examples for you, including:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://git.linaro.org/lava-team/lava-functional-tests.git">https://git.linaro.org/lava-team/lava-functional-tests.git</a></p></li>
<li><p><a class="reference external" href="https://git.linaro.org/qa/test-definitions.git">https://git.linaro.org/qa/test-definitions.git</a></p></li>
</ul>
</section>
<section id="using-specific-branch-of-a-test-definition-repository">
<h2>Using specific branch of a test definition repository<a class="headerlink" href="#using-specific-branch-of-a-test-definition-repository" title="Permalink to this heading">¶</a></h2>
<p>If a public branch is specified as a parameter in the job submission YAML,
that branch of the repository will be used instead of the default ‘master’
branch.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">test</span><span class="p">:</span>
<span class="w">    </span><span class="nt">timeout</span><span class="p">:</span>
<span class="w">      </span><span class="nt">minutes</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">5</span>
<span class="w">    </span><span class="nt">definitions</span><span class="p">:</span>
<span class="w">    </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">repository</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://git.linaro.org/lava-team/lava-functional-tests.git</span>
<span class="w">      </span><span class="nt">from</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">git</span>
<span class="w">      </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lava-test-shell/android/get-adb-serial-hikey.yaml</span>
<span class="w">      </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">get-hikey-serial</span>
<span class="w">      </span><span class="nt">branch</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">stylesen</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Do not supply anything other than a branch name to this parameter,
like tag or revision as this would create a clone in a ‘detached
HEAD’ state.</p>
</div>
</section>
<section id="using-specific-revisions-of-a-test-definition">
<h2>Using specific revisions of a test definition<a class="headerlink" href="#using-specific-revisions-of-a-test-definition" title="Permalink to this heading">¶</a></h2>
<p>If a specific revision is specified as a parameter in the job submission YAML,
that revision of the repository will be used instead of HEAD.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">test</span><span class="p">:</span>
<span class="w">   </span><span class="nt">failure_retry</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3</span>
<span class="w">   </span><span class="nt">timeout</span><span class="p">:</span>
<span class="w">     </span><span class="nt">minutes</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">10</span>
<span class="w">   </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">kvm-basic-singlenode</span>
<span class="w">   </span><span class="nt">definitions</span><span class="p">:</span>
<span class="w">       </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">repository</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">git://git.linaro.org/lava-team/lava-functional-tests.git</span>
<span class="w">         </span><span class="nt">from</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">git</span>
<span class="w">         </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lava-test-shell/smoke-tests-basic.yaml</span>
<span class="w">         </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">smoke-tests</span>
<span class="w">       </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">repository</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http://git.linaro.org/lava-team/lava-functional-tests.git</span>
<span class="w">         </span><span class="nt">from</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">git</span>
<span class="w">         </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lava-test-shell/single-node/singlenode03.yaml</span>
<span class="w">         </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">singlenode-advanced</span>
<span class="w">         </span><span class="nt">revision</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">441b61</span>
</pre></div>
</div>
</section>
<section id="shallow-clones-in-git">
<h2>Shallow clones in GIT<a class="headerlink" href="#shallow-clones-in-git" title="Permalink to this heading">¶</a></h2>
<p>Some git repositories have a long history of commits and using a full clone
takes up a lot of space. When a test job involves multiple test repositories,
this can cause issues with adding the LAVA overlay to the test job. For
example, ramdisks could become too large or there could be insufficient
space in the partition used for the test shell or it could take longer than
desired to transfer the overlay to the device.</p>
<p>When <code class="docutils literal notranslate"><span class="pre">git</span></code> support is requested for a test shell definition, LAVA will
default to making a <strong>shallow</strong> clone using <code class="docutils literal notranslate"><span class="pre">--depth=1</span></code>. The git history
will be truncated to the single most recent commit.</p>
<p>A full clone can be requested by passing the <code class="docutils literal notranslate"><span class="pre">shallow</span></code> parameter with a
value of <code class="docutils literal notranslate"><span class="pre">False</span></code>. If the <code class="docutils literal notranslate"><span class="pre">revision</span></code> option is used, shallow clone
support will need to be turned off or the change to specified revision
will fail.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference external" href="https://git-scm.com/docs/git-clone">https://git-scm.com/docs/git-clone</a></p>
</div>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">test</span><span class="p">:</span>
<span class="w">   </span><span class="nt">failure_retry</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3</span>
<span class="w">   </span><span class="nt">timeout</span><span class="p">:</span>
<span class="w">     </span><span class="nt">minutes</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">10</span>
<span class="w">   </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">kvm-basic-singlenode</span>
<span class="w">   </span><span class="nt">definitions</span><span class="p">:</span>
<span class="w">       </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">repository</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http://git.linaro.org/lava-team/lava-functional-tests.git</span>
<span class="w">         </span><span class="nt">from</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">git</span>
<span class="w">         </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lava-test-shell/single-node/singlenode03.yaml</span>
<span class="w">         </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">singlenode-advanced</span>
<span class="w">         </span><span class="nt">shallow</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">False</span>
</pre></div>
</div>
</section>
<section id="removing-git-history">
<h2>Removing git history<a class="headerlink" href="#removing-git-history" title="Permalink to this heading">¶</a></h2>
<p>The size of the overlay can be an issue for jobs running on small devices.
By default, when cloning test definition from a git repository, LAVA will keep
the <strong>.git</strong> directory.
If needed, this directory can be removed from the overlay by setting
<code class="docutils literal notranslate"><span class="pre">history</span></code> to <strong>false</strong>.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">test</span><span class="p">:</span>
<span class="w">   </span><span class="nt">failure_retry</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3</span>
<span class="w">   </span><span class="nt">timeout</span><span class="p">:</span>
<span class="w">     </span><span class="nt">minutes</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">10</span>
<span class="w">   </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">kvm-basic-singlenode</span>
<span class="w">   </span><span class="nt">definitions</span><span class="p">:</span>
<span class="w">       </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">repository</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http://git.linaro.org/lava-team/lava-functional-tests.git</span>
<span class="w">         </span><span class="nt">from</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">git</span>
<span class="w">         </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lava-test-shell/single-node/singlenode03.yaml</span>
<span class="w">         </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">singlenode-advanced</span>
<span class="w">         </span><span class="nt">history</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">False</span>
</pre></div>
</div>
</section>
<section id="sharing-the-contents-of-test-definitions">
<h2>Sharing the contents of test definitions<a class="headerlink" href="#sharing-the-contents-of-test-definitions" title="Permalink to this heading">¶</a></h2>
<p>A YAML test definition file can clone another repository by specifying the
address of the repository to clone</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">install</span><span class="p">:</span>
<span class="w">    </span><span class="nt">git-repos</span><span class="p">:</span>
<span class="w">        </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">git://git.linaro.org/people/davelong/lt_ti_lava.git</span>

<span class="nt">run</span><span class="p">:</span>
<span class="w">    </span><span class="nt">steps</span><span class="p">:</span>
<span class="w">        </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">cd lt_ti_lava</span>
<span class="w">        </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">echo &quot;now in the git cloned directory&quot;</span>
</pre></div>
</div>
<p>This allows a collection of LAVA test definitions to re-use other YAML custom
scripts without duplication. The tests inside the other repository will <strong>not</strong>
be executed.</p>
</section>
<section id="test-repository-for-functional-tests-in-lava">
<h2>Test repository for functional tests in LAVA<a class="headerlink" href="#test-repository-for-functional-tests-in-lava" title="Permalink to this heading">¶</a></h2>
<p>LAVA regularly runs a set of test definitions to check for regressions and the
set is available for others to use as a template for their own tests:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">*</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">git</span><span class="o">.</span><span class="n">linaro</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">lava</span><span class="o">-</span><span class="n">team</span><span class="o">/</span><span class="n">lava</span><span class="o">-</span><span class="n">functional</span><span class="o">-</span><span class="n">tests</span><span class="o">.</span><span class="n">git</span>
</pre></div>
</div>
</section>
<section id="using-kernel-messages-in-a-test-shell">
<span id="test-definition-kmsg"></span><h2>Using kernel messages in a test shell<a class="headerlink" href="#using-kernel-messages-in-a-test-shell" title="Permalink to this heading">¶</a></h2>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="connections.html#simple-job-flow"><span class="std std-ref">Simple test job flow</span></a> for
background on serial corruption and interleaving of kernel
messages with test output. Also <a class="reference internal" href="connections.html#isolating-kernel-messages"><span class="std std-ref">Isolating kernel messages from test output</span></a>
for information on using multiple serial connections to prevent
such issues.</p>
</div>
<p>In situations where multiple serial ports are not available, there is
a possible mitigation to the problem of serial corruption of test shell
messages by kernel messages.</p>
<p>This is an example of the interleaving of kernel messages and test
shell messages:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;LAVA_SIGNAL_ENDRUN 0_network[   31.811978] ------------[ cut here ]------------
-inline 14658_3.[   31.818261] WARNING: CPU: 4 PID: 2576 at /srv/oe/build/tmp-rpb-glibc/work-shared/hikey/kernel-source/include/net/sock.h:1703 af_alg_accept+0x1d8/0x208 [af_alg]
2.3.1&gt;
&lt;LAVA_TE[   31.834094] Modules linked in: algif_hash af_alg smsc75xx usbnet adv7511 kirin_drm drm_kms_helper dw_drm_dsi drm fuse
Received signal: &lt;ENDRUN&gt; 0_network[   31.811978] ------------[ cut here ]------------
-inline 14658_3.[   31.818261] WARNING: CPU: 4 PID: 2576 at /srv/oe/build/tmp-rpb-glibc/work-shared/hikey/kernel-source/include/net/sock.h:1703 af_alg_accept+0x1d8/0x208 [af_alg]
2.3.1
Ending use of test pattern.
Ending test lava.0_network[ (31.811978]), duration 1.92
case: 0_network[
case_id: 875068
definition: lava
duration: 1.92
namespace: hikey-oe
path: None
repository: None
result: pass
revision: unspecified
uuid: 31.811978]
_on_endrun() takes exactly 3 arguments (20 given)
</pre></div>
</div>
<p>The expected signal would have been more like the another message
of this type in the same test job:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&lt;LAVA_SIGNAL_ENDRUN 1_kselftest 14658_3.2.3.5&gt;
Received signal: &lt;ENDRUN&gt; 1_kselftest 14658_3.2.3.5
Ending use of test pattern.
Ending test lava.1_kselftest (14658_3.2.3.5), duration 0.00
case: 1_kselftest
case_id: 876176
commit_id: fd1f392f983803e7189e264dda22790c54950c8f
definition: lava
duration: 0.0057
namespace: hikey-oe
path: automated/linux/kselftest/kselftest.yaml
repository: git://git.linaro.org/qa/test-definitions.git
result: pass
revision: unspecified
uuid: 14658_3.2.3.5
&lt;LAVA_TEST_RUNNER&gt;: 1_kselftest exited with: 0
</pre></div>
</div>
<p>As described in <a class="reference internal" href="connections.html#simple-job-flow"><span class="std std-ref">isolating kernel messages</span></a> in
the section on Multiple serial port support, this happens because the
test shell message <code class="docutils literal notranslate"><span class="pre">&lt;LAVA_SIGNAL_ENDRUN</span> <span class="pre">1_kselftest</span> <span class="pre">14658_3.2.3.5&gt;</span></code>
is sent to <code class="docutils literal notranslate"><span class="pre">stdout</span></code>. If the message was sent to <code class="docutils literal notranslate"><span class="pre">/dev/kmsg</span></code> then
the kernel would take care of emitting the entire line <strong>before</strong> (or
just <strong>after</strong>) emitting the warning. The test shell message would
remain intact and processing could continue normally.</p>
<section id="syntax">
<h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this heading">¶</a></h3>
<p>Test writers can decide which test shell definitions need to use this
support and which continue to use <code class="docutils literal notranslate"><span class="pre">stdout</span></code>.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="w">    </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">repository</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">http://git.linaro.org/lava-team/lava-functional-tests.git</span>
<span class="linenos"> 2</span><span class="w">      </span><span class="nt">from</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">git</span>
<span class="hll"><span class="linenos"> 3</span><span class="w">      </span><span class="nt">lava-signal</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">kmsg</span>
</span><span class="linenos"> 4</span><span class="w">      </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lava-test-shell/smoke-tests-basic.yaml</span>
<span class="linenos"> 5</span><span class="w">      </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">smoke-tests</span>
<span class="linenos"> 6</span><span class="w">    </span><span class="c1"># this test definition will use stdout</span>
<span class="linenos"> 7</span><span class="w">    </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">repository</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://git.linaro.org/lava-team/lava-functional-tests.git</span>
<span class="linenos"> 8</span><span class="w">      </span><span class="nt">from</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">git</span>
<span class="linenos"> 9</span><span class="w">      </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">lava-test-shell/single-node/singlenode03.yaml</span>
<span class="linenos">10</span><span class="w">      </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">singlenode-advanced</span>
</pre></div>
</div>
<p>By specifying <code class="docutils literal notranslate"><span class="pre">lava-signal:</span> <span class="pre">kmsg</span></code> for the first test shell definition
in the test job submission example above, LAVA can output the test
shell messages to <code class="docutils literal notranslate"><span class="pre">/dev/kmsg</span></code>, resulting in output like:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>[    8.862986] &lt;LAVA_SIGNAL_ENDRUN 0_smoke-tests 1998_1.2.3.1&gt;
+ export TESTRUN_ID=1_singlenode-advanced
+ TESTRUN_ID=1_singlenode-advanced
+ cd /lava-1998/0/tests/1_singlenode-advanced
++ cat uuid
+ UUID=1998_1.2.3.5
+ set +x
&lt;LAVA_SIGNAL_STARTRUN 1_singlenode-advanced 1998_1.2.3.5&gt;
+ apt-get update -q
Received signal: &lt;TESTCASE&gt; TEST_CASE_ID=linux-linaro-ubuntu-lsb_release RESULT=fail
case: linux-linaro-ubuntu-lsb_release
case_id: 49920
definition: 0_smoke-tests
result: fail
Received signal: &lt;ENDRUN&gt; 0_smoke-tests 1998_1.2.3.1
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<ul class="simple">
<li><p>The LAVA test shell messages are now prefixed with the kernel
message time stamp - this does not affect processing which is
restricted to the content between the <code class="docutils literal notranslate"><span class="pre">&lt;</span></code> and <code class="docutils literal notranslate"><span class="pre">&gt;</span></code> markers.</p></li>
<li><p>When describing <code class="docutils literal notranslate"><span class="pre">stdout</span></code>, <code class="docutils literal notranslate"><span class="pre">stderr</span></code> is implicitly included.</p></li>
<li><p>The ordering of messages in the output shows the inherent
latency in the message processing.</p></li>
</ul>
</div>
</section>
<section id="limitations">
<span id="kmsg-signal-limitations"></span><h3>Limitations<a class="headerlink" href="#limitations" title="Permalink to this heading">¶</a></h3>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>If the limitations with this approach make it unsuitable,
<a class="reference internal" href="connections.html#multiple-serial-support"><span class="std std-ref">Multiple serial port support</span></a> is preferred, where available.</p>
</div>
<section id="login">
<h4>Login<a class="headerlink" href="#login" title="Permalink to this heading">¶</a></h4>
<p>The login shell is not part of the LAVA test shell, it is the final
part of the boot sequence and the input/output of the login shell is
not under the control of LAVA. If kernel messages appear when the
device is attempting to read in the username or password or if a
message appears when the login shell is attempting to output the
prompt, then the parsing will still fail.</p>
</section>
<section id="stdout">
<h4>stdout<a class="headerlink" href="#stdout" title="Permalink to this heading">¶</a></h4>
<p>The problem of interleaving messages from multiple inputs onto a single
output has not gone away by sending the LAVA test shell messages to
<code class="docutils literal notranslate"><span class="pre">/dev/kmsg</span></code>. There is still only a single serial connection which
<strong>must</strong> be shared between all <code class="docutils literal notranslate"><span class="pre">stdout</span></code> output and all <code class="docutils literal notranslate"><span class="pre">console</span></code>
output. Test shell operations which produce a lot of <code class="docutils literal notranslate"><span class="pre">stdout</span></code> and/or
<code class="docutils literal notranslate"><span class="pre">stderr</span></code> output can still flood the serial connection and interrupt
kernel message lines.</p>
</section>
<section id="definitions">
<h4>Definitions<a class="headerlink" href="#definitions" title="Permalink to this heading">¶</a></h4>
<p>Not all LAVA test shell operations can be sent to <code class="docutils literal notranslate"><span class="pre">/dev/kmsg</span></code> - some
will go to <code class="docutils literal notranslate"><span class="pre">stdout</span></code> even if all test definitions are marked to use
<code class="docutils literal notranslate"><span class="pre">/dev/kmsg</span></code> because the test shell runner script needs to be the same
for all definitions.</p>
</section>
</section>
</section>
</section>


    </div>
      
  </div>
</div>
<footer class="footer">
  <div class="container">
    <p class="pull-right">
      <a href="#">Back to top</a>
      
    </p>
    <p>
        &copy; Copyright 2010-2019, Linaro Limited.<br/>
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 5.3.0.<br/>
    </p>
  </div>
</footer>
  </body>
</html>